import { Student } from '../entities/student.entity';
import {
  IsOptional,
  ArrayNotEmpty,
  IsArray
} from 'class-validator';
import { PartialType } from '@nestjs/swagger';

export class CreateStudentDto {
  form: Student;
}

export class UpdateStudentDto extends PartialType(CreateStudentDto) {}

export class QueryStudentDto {
  @IsOptional()
  age: number;

  @IsOptional()
  class: string;

  @IsOptional()
  name: string;

  pageSize: number;

  pageNum: number;
}

export class DeleteStudentDto {
  @IsArray()
  @ArrayNotEmpty()
  ids: number[];
}
